﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProductionManagement.Domain.Dtos
{
    public class AddProductOrderDTO
    {
        /// <summary>
        /// 生产订单id
        /// </summary>
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
        public int POId { get; set; }
        /// <summary>
        /// 单据编号
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设计长度
        public string? POrderNumber { get; set; }
        /// <summary>
        /// 生产订单主题
        /// </summary>
        public string? POrderTopic { get; set; }
        /// <summary>
        /// 制单人员
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设计长度
        public string? PDocumentMakers { get; set; }
        /// <summary>
        /// 制单日期
        /// </summary>
        public DateTime? PDocumentDate { get; set; }
        /// <summary>
        /// 生产计划id
        /// </summary>
        public int? ProductionPlansId { get; set; }
        /// <summary>
        ///  计划名称
        /// </summary>
        public string? PPlanName { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(200)")]//设计长度
        public string? PRemark { get; set; }
        /// <summary>
        /// 销售合同id
        /// </summary>
        public int? SaleContractId { get; set; }
        /// <summary>
        /// 合同主题
        /// </summary>
        public string? ContractTopic { get; set; }
        /// <summary>
        /// 数据合计
        /// </summary>
        public int? TotalData { get; set; }

        /// <summary>
        /// 添加人姓名
        /// </summary>
        public string? AddName { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime? AddTime { get; set; }
        /// <summary>
        /// 公司id
        /// </summary>
        public string? Office_Id { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        public int? User_Id { get; set; }

        public List<OrderDetail> DetailList { get; set; }
    }


    public class OrderDetail
    {
        /// <summary>
        /// 生产产品id
        /// </summary>
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true)]//自增主键
        public int? PPId { get; set; }
        /// <summary>
        /// 生产订单id
        /// </summary>
        public string? POId { get; set; }
        /// <summary>
        /// 订单数量
        /// </summary>
        public int? POrderNum { get; set; }
        /// <summary>
        /// 生产类型
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设计长度
        public string? ProductionType { get; set; }
        /// <summary>
        /// 开工时间
        /// </summary>
        public DateTime? PStartTime { get; set; }
        /// <summary>
        /// 完工日期
        /// </summary>
        public DateTime? PCompletionDate { get; set; }
        /// <summary>
        /// 交货日期
        /// </summary>
        public DateTime? PDeliveryDate { get; set; }
        /// <summary>
        /// 产品id
        /// </summary>
        public int? ProductId { get; set; }
        /// <summary>
        /// 生产计划id
        /// </summary>
        public int? ProductionPlansId { get; set; }
        /// <summary>
        /// 添加人姓名
        /// </summary>
        public string? AddName { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime? AddTime { get; set; }
        /// <summary>
        /// 公司id
        /// </summary>
        public string? Office_Id { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        public int? User_Id { get; set; }
    }
}
